//删除
function del(uri, id, uriBack, msg) {
    layer.confirm(msg, {
        title: '删除确认',
        btn: ['确定', '取消'] //按钮
    }, function () {
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': '{{ csrf_token() }}'
            }
        });
        var load = layer.load();
        $.get(uri + id, {},
            function (data) {
            console.log(data)
                layer.close(load);
                if (data.code === 0) {
                    layer.msg(data.msg, {
                        offset: '15px'
                        , icon: 1
                        , time: 1000
                    }, function () {
                        location.href = uriBack;
                    });
                } else {
                    layer.msg(data.msg, {
                        offset: '15px'
                        , icon: 2
                        , time: 2000
                    });
                }
            });
    });
}

//ajax
function gAndp(uri,data,method,callback){
    $.ajax({
        url: uri,
        data: data,
        method: method,
        success: function (res) {
            callback(res)
        }
    });
}
